package com.example.apidemo.login;

import com.example.apidemo.redis.JedisUtil;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//import java.util.concurrent.TimeUnit;

@RestController
@RequestMapping("/txt")
public class TxtController {

/*    @Autowired
    RedisTemplate redisTemplate;

    public TxtController(RedisTemplate redisTemplate) {
        this.redisTemplate = redisTemplate;
    }*/

    @RequestMapping("/inder3")
    public String getInder3() {

        System.out.println("inder3");
        for (int i = 0; i < 100000; i++) {
            JedisUtil.set(0, "" + i, "" + i, 30);
            // redisTemplate.opsForValue().set("" + i, i, 30, TimeUnit.SECONDS);
        }
        return "001";
    }

    @RequestMapping("/inder4")
    public String getInder4() {
        System.out.println("inder4");
        for (int i = 0; i < 50000; i++) {
            System.out.println(JedisUtil.get("" + i));
        }
        return "001";
    }
}
